<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2014 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
/**
 * 阿里云上传
 */
namespace Portal\Controller;
use Common\Controller\HomebaseController;
class OssController extends HomebaseController {
    //阿里云上传
    public function upload() {
    	
		$config = array(    
			'maxSize'    =>    314572800,    
			'savePath'   =>    './Public/Uploads/',   
			'saveName'   =>    array('uniqid','__FILE__'),   
			'exts'       =>    array('jpg', 'gif', 'png', 'jpeg'),    
	
		);
		
		$oss_config = array(
		'access_id'   =>    'lu0Zsxd9ptXcjbjH',   
		'access_key'   =>    'GFe5xAOiRUm3hOUddBuVsPphxrtAVA',   
		'bucket'   =>    'wentianxia',   
			   
		
		);
		$upload    = new \Think\Upload($config, 'Oss', $oss_config);
		$info   =   $upload->upload();
		 if(!$info) {// 上传错误提示错误信息      
			$this->error($upload->getError());   
		 }else{// 上传成功       
			$this->success("1111");   
		 }
		
    }
    
    
}
